home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 October / CHIP Ekim 1996.iso / winbatch / saver.wb_ < prev    next >
Text File  |  1994-07-25  |  5KB  |  155 lines

  1. cr=Num2Char(13)
  2. lf=Num2char(10)
  3. crlf=StrCat(cr,lf)
  4.  
  5. info1="                                                           Hi!"
  6. info2="This mini app diddles with the Flying Windows Screensaver."
  7. info3="It modifies the SSFLYWIN.SCR file and inserts the character of your choice from the Wingdings Character Set."
  8. info4="Don't worry, we make a backup of the file, SSFLYWIN.BAK, so you can return to the original at any time."
  9. info5="Do you want to continue?"
  10.  
  11. ;Clear the clipboard
  12. ClipPut("")
  13.  
  14. a=AskYesNo("Tina's Free Festive Flying Font FunSaver", StrCat(info1, crlf, crlf, info2, crlf, crlf, info3, crlf, crlf, info4, crlf, crlf, info5))
  15. if a==@NO then goto cancel
  16.  
  17.  
  18. ;Advise the user to select a character, press copy and then close CharMap.
  19. Display(4, "Tina's Free Festive Flying Font FunSaver", "SELECT one character %CRLF%choose COPY %CRLF%CLOSE the Character Map")
  20.  
  21.  
  22. :fontselect
  23. ;Read the Win.ini MSCharMap section to see what font is there.
  24. orgfont=IniRead("MSCharMap", "Font", "NO DEFAULT")
  25.  
  26.  
  27. ;Change the font to Wingdings.
  28. newfont=IniWrite("MSCharMap", "Font", "Wingdings")
  29.  
  30.   
  31. ;Run the character map.
  32. RunWait("CHARMAP.EXE", "")
  33.  
  34.  
  35. ;Change the font back to what it originally was.
  36. if orgfont!="NO DEFAULT" then IniWrite("MSCharMap", "Font", orgfont)
  37.  
  38.  
  39. ;Get the character/symbol off of the clipboard.
  40. symbol=ClipGet()
  41. If symbol == "" 
  42.      Ask=AskYesNO("Symbol Selection", "No character was found, do you want to choose another?")
  43.      If ask == 1 then goto fontselect
  44. endif
  45.  
  46.           
  47. ;Convert the character to a number.
  48. magicnum=Char2Num(symbol)
  49. ;message("", magicnum)
  50.  
  51.  
  52. ;Build the path to the Windows directory and SSFLYWIN.SCR.
  53. wherewin=DirWindows(0)
  54. flywin=StrCat(wherewin, "SSFlyWin.SCR")
  55.  
  56.  
  57. ;Check to see if they have a back up file, if not create it.
  58. flywinbak=StrCat(wherewin, "SSFlyWin.bak")
  59. If FileExist(flywinbak)==@NO then FileCopy(flywin, flywinbak, @False)
  60.  
  61.  
  62. ;Check file size of SSFLYWIN.SCR.  If it is not equal to 16160 it is not the correct version.
  63. size=FileSize(flywin)
  64. If size != 16160 
  65.      Message("Whoops %size%", "This Script doesn't work with your version of Flying Windows. %CRLF% SORRY")
  66.      goto cancel
  67. endif
  68.  
  69.  
  70. ;Set the memory buffer.
  71. binbuf=BinaryAlloc(size)
  72. if binbuf ==0 
  73.      Message("ERROR", "BinaryAlloc Failed")
  74. else
  75.      ;read into the buffer
  76.      BinaryRead(binbuf, flywin)
  77.      ;insert the new number into the correct offset.
  78.      BinaryPoke(binbuf, 11762, magicnum)
  79.      ;write the file out.
  80.      BinaryWrite(binbuf, flywin)
  81.      ;free the buffer
  82.      BinaryFree(binbuf)
  83. endif
  84.  
  85.  
  86. :dlg                         
  87. ;Display a dialog box for the user to test the new selection.
  88. FlyWinFormat=`WWWDLGED,5.0`
  89.  
  90. FlyWinCaption=`Tina's Free Festive Flying Font FunSaver`
  91. FlyWinX=74
  92. FlyWinY=80
  93. FlyWinWidth=243
  94. FlyWinHeight=154
  95. FlyWinNumControls=10
  96.  
  97. FlyWin01=`16,38,80,DEFAULT,PUSHBUTTON,DEFAULT,"TEST",1`
  98. FlyWin02=`80,118,80,DEFAULT,PUSHBUTTON,DEFAULT,"EXIT",0`
  99. FlyWin03=`33,8,184,DEFAULT,STATICTEXT,DEFAULT,"The new symbol has been entered into your screensaver. "`
  100. FlyWin04=`104,38,88,DEFAULT,STATICTEXT,DEFAULT,"Test fly your new font."`
  101. FlyWin05=`16,56,80,DEFAULT,PUSHBUTTON,DEFAULT,"SET SCREENSAVER",2`
  102. FlyWin06=`104,56,120,DEFAULT,STATICTEXT,DEFAULT,"Set Flying Font as your Screensaver."`
  103. FlyWin07=`104,91,104,DEFAULT,STATICTEXT,DEFAULT,"Choose another font character."`
  104. FlyWin08=`16,91,80,DEFAULT,PUSHBUTTON,DEFAULT,"SET FONT",3`
  105. FlyWin09=`16,73,80,DEFAULT,PUSHBUTTON,DEFAULT,"SET OPTIONS",4`
  106. FlyWin10=`104,73,97,DEFAULT,STATICTEXT,DEFAULT,"Set Flying Font setup options"`
  107.  
  108. ButtonPushed=Dialog("FlyWin")
  109.  
  110.  
  111. ;Run the screensaver.
  112. delay(2)
  113. ;return value 1 tests the funsaver.
  114. If ButtonPushed == 1 then goto test   
  115.  
  116. ;return value 2 sets the funsaver in the win.ini and system.ini 
  117. If ButtonPushed == 2 then goto setsaver
  118.  
  119. ;return value 3 sends user back to the character map to select another font.
  120. If ButtonPushed == 3 then goto fontselect
  121.  
  122. If ButtonPushed == 4 then goto options
  123.  
  124.  
  125. :Cancel
  126. Exit 
  127.  
  128. :test
  129. RunWait("SSFlywin*scr", "/s")
  130. goto dlg
  131.  
  132.   
  133. :setsaver
  134. ;turn the screensaver on and set the timeout.
  135. a=WinParmGet(7)
  136. b=WinParmGet(8)
  137.  
  138. WinParmSet(7, "480", 1)
  139. WinParmSet(8, "1", 1)
  140.  
  141. ;Read the Win.ini and replace the screensaver with SSflywin.scr 
  142. IniWritePvt("boot", "SCRNSAVE.EXE", Flywin, "System.ini")
  143.  
  144. Display(3,"Tina's Free Festive Flying Font FunSaver", "%crlf% The new font is set. %crlf% %crlf% Please adjust the following settings.") 
  145.  
  146. delay(2)
  147. :options
  148. RunWait("SSFlywin*scr", "")
  149.  
  150. Display(3,"Tina's Free Festive Flying Font FunSaver", "Launching Festive Flying Font FunSaver") 
  151.  
  152. RunWait("SSFlywin*scr", "/s") 
  153.  
  154. goto dlg
  155.